<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>百慧wms仓库</title>
  <link href="layui/css/layui.css" rel="stylesheet">
  <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="img/ico/favicon.ico" />
  <link rel="stylesheet" href="css/hxx.css">
</head>
<body>

	<!-- 顶部 -->
	<div class="hxx-top">
		<ul class="hxx-left">
			<li><a href="/">百慧wms仓库</a></li>
		</ul>
		<ul class="layui-nav hxx-nav">
		  <li class="layui-nav-item hxx-nav-item">
		      <a><img id="avatarId" src="/img/avatar.jpeg" class="layui-nav-img"> <span id="userNick">1枫桥夜泊</span> </a>
		      <dl class="layui-nav-child">
		        <dd><a id="muid" href="javascript:void(0);">修改信息</a></dd>
		        <dd><a href="/logout">退出登录</a></dd>
		      </dl>
		    </li>
		</ul>
	</div>
	<!-- 内容区 -->
	<div class="hxx-container">
		
		<!-- 左侧导航 -->
		<div class="hxx-container-left">
			<div class="layui-panel">
			  <ul class="layui-menu" id="hxxmenuid">
				<li class="layui-menu-item-group layui-menu-item-up" lay-options="{type: 'group'}">
				  <div class="layui-menu-body-title">
					  仪表盘 <i class="layui-icon layui-icon-down"></i>
				  </div>
				  <ul>
					  <li onclick="add_tab('商业智能','pages/statisticsList.html')">商业智能</li>
				  </ul>
				</li>
				<li class="layui-menu-item-divider"></li>
				<li class="layui-menu-item-group layui-menu-item-up" lay-options="{type: 'group'}">
				  <div class="layui-menu-body-title">
				    系统设置 <i class="layui-icon layui-icon-down"></i>
				  </div>
				  <ul>
				    <li onclick="add_tab('用户管理','pages/userList.html')">用户管理</li>
					<li onclick="add_tab('角色管理','pages/roleList.html')">角色管理</li>
					<li onclick="add_tab('部门管理','pages/departmentList.html')">部门管理</li>
					<li onclick="add_tab('菜单管理','pages/menusList.html')">菜单管理</li>
				  </ul>
				</li>
				<li class="layui-menu-item-divider"></li>
				<li class="layui-menu-item-group layui-menu-item-up" lay-options="{type: 'group'}">
				  <div class="layui-menu-body-title">
				    基础数据 <i class="layui-icon layui-icon-down"></i>
				  </div>
				  <ul>
					<li onclick="add_tab('产品管理','pages/productList.html')">产品管理</li>
					<li onclick="add_tab('客户管理','pages/customerList.html')">客户管理</li>
					<li onclick="add_tab('供应商管理','pages/supplierList.html')">供应商管理</li>
					<li onclick="add_tab('承运商管理','pages/carrierList.html')">承运商管理</li>
				  </ul>
				</li>
				<li class="layui-menu-item-divider"></li>
				<li class="layui-menu-item-group layui-menu-item-up" lay-options="{type: 'group'}">
				  <div class="layui-menu-body-title">
				    仓库管理 <i class="layui-icon layui-icon-down"></i>
				  </div>
				  <ul>
				    <li onclick="add_tab('仓库管理','pages/warehouseList.html')">仓库管理</li>
					<li onclick="add_tab('货物入库','pages/warehouseIn.html')">货物入库</li>
					<li onclick="add_tab('货物出库','pages/warehouseOut.html')">货物出库</li>
					<li onclick="add_tab('库存查询','pages/productStock.html')">库存查询</li>
				  </ul>
				</li>
				<li class="layui-menu-item-divider"></li>
				<li class="layui-menu-item-group layui-menu-item-up" lay-options="{type: 'group'}">
				  <div class="layui-menu-body-title">
				    字典管理 <i class="layui-icon layui-icon-down"></i>
				  </div>
				  <ul>
				    <li onclick="add_tab('产品类目','pages/categoryList.html')">产品类目</li>
					<li onclick="add_tab('客户级别','pages/customerLevelList.html')">客户级别</li>
					<li onclick="add_tab('客户来源','pages/customerSourceList.html')">客户来源</li>
					  <li onclick="add_tab('客户行业','pages/customerIndustryList.html')">客户行业</li>
				  </ul>
				</li>
				<li class="layui-menu-item-divider"></li>
				<li class="layui-menu-item-group layui-menu-item-up" lay-options="{type: 'group'}">
				  <div class="layui-menu-body-title">
				    日志管理 <i class="layui-icon layui-icon-down"></i>
				  </div>
				  <ul>
				    <li onclick="add_tab('系统日志','pages/sysLog.html')">系统日志</li>
					<li onclick="add_tab('登录日志','pages/userLog.html')">登录日志</li>
				  </ul>
				</li>
			  </ul>
			</div>
		</div>
		<!-- 右侧内容 -->
		<div class="hxx-container-right">
			<div class="layui-tab nav-tab" lay-allowClose="true" lay-filter="nav_filter">
			  <ul class="layui-tab-title">
			    <li class="home layui-this">
					<i class="layui-icon layui-icon-home"></i> 首页
				</li>
			  </ul>
			  <div class="layui-tab-content">
			    <div class="layui-tab-item layui-show">
					<iframe style="border: none"  class="hxx-iframe" src="pages/welcome.html"></iframe>
				</div>
			  </div>
			</div>
		</div>
	</div>
	<div class="hxx-footer">
		<p>百慧wms仓库v1.0</p>
	</div>
<script src="layui/layui.js"></script>
<script src="js/md5.min.js"></script>
<script src="js/hxx.js"></script>
<script>
	layui.use(['jquery','layer'],function () {
		let layer = layui.layer;
		let $ = layui.jquery;
		/**
		 *  获取用户头像
		 *  1. 判断是否登录,cookie是否有值
		 *  2. 如果不存在值,说明没有登录,不需要查询
		 */
		let cookies = document.cookie;
		let split = cookies.split(";");
		let c = {};
		for (let i = 0; i < split.length; i++) {
			let ss = split[i].split("=");
			c[ss[0].trim()]=ss[1]; //key值需要去空格
		}
		if(c!=null && c.userId!=null && c.userId!="" && c.userId!="undefined"){
			$.getJSON("/getUserDetail",{userId:c.userId},function (d) {
				//console.log(d);
				if(d.code===0){
					//获取头像的DOM节点
					$("#avatarId")[0].src=d.obj.avatar;
				}else{
					layer.msg(d.msg);
				}
			});
		}
	});
</script>
</body>
</html>